//
//  FDNowDataView.m
//  FD
//
//  Created by xiaofang wang on 2018/11/26.
//  Copyright © 2018年 ZhiYuan Network. All rights reserved.
//

#import "FDNowDataView.h"
@interface FDNowDataView()
/**没有数据lb*/
@property (nonatomic, strong) UILabel *noDateLb;
@end

@implementation FDNowDataView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupView];
    }
    return self;
}

- (void)setupView {
    [self addSubview:self.noDateLb];
}

- (UILabel *)noDateLb {
    if (!_noDateLb) {
        _noDateLb = [UILabel new];
        _noDateLb.frame = CGRectMake(0, 0, 250, 30);
        
        NSString *str = @"No Data";
        if ([NSString rb_ChineseLanguage]) {
            str = @"暂无数据";
        }
        _noDateLb.textColor = [UIColor lightGrayColor];
        _noDateLb.text = str;
        
        _noDateLb.textAlignment = NSTextAlignmentCenter;
    }
    return _noDateLb;
}

- (void)layoutSubviews {
    
    [super layoutSubviews];
    
    FDLog(@"%@",NSStringFromCGRect(self.frame));
    
    [self.noDateLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.mas_centerY);
        make.centerX.equalTo(self.mas_centerX);
        make.size.mas_equalTo(CGSizeMake(300, 40));
    }];
}




/**2019-2-23 这个适用于消息页面,没有数据*/
- (void)changeTipsToNoMessageYet {
    NSString *str = @"No message yet";
    if ([NSString rb_ChineseLanguage]) {
        str = @"暂无消息";
    }
    
    self.noDateLb.text = str;
    
}

@end
